﻿package com.flashshe.ds.list
{
	public class DoublyLinkedListElement
	{
		/**
		 * 元素的值
		 */
		public var value:Object;
		
		/**
		 * 前一个元素
		 */
		public var previousElement:DoublyLinkedListElement;
		
		/**
		 * 下一个元素
		 */
		public var nextElement:DoublyLinkedListElement;
		
				
		public function DoublyLinkedListElement(value:Object, 
												nextElement:DoublyLinkedListElement=null,
												previousElement:DoublyLinkedListElement=null)
		{
			this.value = value;
			
			this.nextElement = nextElement;			
			if (this.nextElement)
			{
				this.nextElement.previousElement = this;
			}
						
			this.previousElement = previousElement;
			if (this.previousElement)
			{
				this.previousElement.nextElement = this;
			}
		}
	}
}